home *** CD-ROM | disk | FTP | other *** search
- property pFlea, spriteNum, pNewPoint, pPower, pDiffer, pGravity, pDistance, pJump
-
- on beginSprite me
- pFlea = sprite(spriteNum)
- pFlea.locZ = spriteNum - 100
- pGravity = 0.40000000000000002
- pDistance = random(10) + 10
- pJump = 1
- end
-
- on enterFrame me
- if pJump then
- pNewPoint = point(pFlea.loc[1] + (random(101) - 51), pFlea.loc[2] + (random(101) - 51))
- ass = [-1, 1]
- pPower = -((float(pNewPoint[2]) - pFlea.loc[2]) * 0.08) * 0.80000000000000004 * random(ass.count)
- pDiffer = (float(pNewPoint[1]) - pFlea.loc[1]) * 0.08 * 0.80000000000000004 * random(ass.count)
- pJump = 0
- else
- if not pJump then
- if pDistance > 0 then
- pPower = pPower - pGravity
- pDistance = pDistance - 1
- pFlea.locH = pFlea.locH - pDiffer
- pFlea.locV = pFlea.locV - pPower
- if (pFlea.locH < -1) or (pFlea.locH > ((the stage).rect.width - 400)) then
- pFlea.locH = random(75)
- else
- if (pFlea.locV < -1) or (pFlea.locV > ((the stage).rect.height + 1)) then
- pFlea.locV = random(200) + 100
- end if
- end if
- else
- pJump = 1
- pDistance = random(10) + 10
- end if
- end if
- end if
- end
-